/* $Id: guiGhl.h V1.0 2001/10/20 */
/*************************************************************************
 *    This source code has been made available to you by EPSON on an AS-IS
 *    basis.  Anyone receiving this source is licensed under EPSON
 *    copyrights to use it in any way he or she deems fit, including
 *    copying it, modifying it, compiling it, and redistributing it either
 *    with or without modifications.
 *
 *    Any person who transfers this source code or any derivative work
 *    must include the EPSON copyright notice, this paragraph, and the
 *    preceding two paragraphs in the transferred software.
 *
 *    COPYRIGHT   EPSON  CORPORATION 2001
 *    LICENSED MATERIAL  -  PROGRAM PROPERTY OF EPSON
 ***********************************************************************/

/***********************************************************************
 * FILE: guiGhl.h
 * MODULE: Graphic abstract layer
 *
 * PURPOSE:
 * AUTHOR(S): YangCX
 * GROUP: GUI Group
 * DATE CREATED: 2001/10/20
 * REFERENCE DOCUMENT ID:
 * MODIFICATIONS:
 *   Date           userName     Description
 *   2001/09/20     YangCX       Create this file
 **********************************************************************/
#ifndef _GALGHL_H
#define _GALGHL_H

#ifdef __cplusplus
extern "C" {
#endif

/* planes mode */
#define GAL_TYPE_VGA_PLANES     4
#define GAL_TYPE_PACKED_PIXELS  1
#define GAL_TYPE_UNKNOWN        0


/* screendriver entry points: one required for each draw function*/
typedef struct T_GAL_ScreenDevice{
	T_WORD	xRes;			/* X screen res (real) */
	T_WORD	yRes;			/* Y screen res (real) */
	T_WORD	bpp;			/* # bits per pixel*/
	T_WORD	planes;			/* # planes*/
	T_VOID *(*InitScrDev)(T_VOID);
    T_VOID	(*SetPalette)(T_GAL_pGC pGC,T_WORD first, T_WORD count, T_GUI_COLOR *cmap);
	T_VOID	(*GetPalette)(T_GAL_pGC pGC,T_WORD first, T_WORD count, T_GUI_COLOR *cmap);
	T_VOID 	(*DrawPixel) (T_GAL_pGC pGC, T_WORD x, T_WORD y, T_GUI_PIXEL c);
	T_GUI_PIXEL (*ReadPixel) (T_GAL_pGC pGC, T_WORD x, T_WORD y);
	T_VOID	(*DrawHLine) (T_GAL_pGC pGC, T_WORD x, T_WORD y, T_WORD w, T_GUI_PIXEL c);
	T_VOID	(*PutHLine)  (T_GAL_pGC pGC, T_WORD x, T_WORD y, T_WORD w, T_VOID* buf);
	T_VOID	(*GetHLine)  (T_GAL_pGC pGC, T_WORD x, T_WORD y, T_WORD w, T_VOID* buf);
	T_VOID	(*DrawVLine) (T_GAL_pGC pGC, T_WORD x, T_WORD y, T_WORD h, T_GUI_PIXEL c);
	T_VOID	(*PutVLine)  (T_GAL_pGC pGC, T_WORD x, T_WORD y, T_WORD h, T_VOID* buf);
	T_VOID	(*GetVLine)  (T_GAL_pGC pGC, T_WORD x, T_WORD y, T_WORD h, T_VOID* buf);
	T_VOID 	(*Blit)(
			 T_GAL_pGC 	DstpGC,
			 T_WORD DstX,
			 T_WORD DstY,
			 T_WORD w,
			 T_WORD h,
			 T_GAL_pGC 	SrcpGC,
			 T_WORD SrcX,
			 T_WORD SrcY
			 );
	T_VOID	(*PutBox)(T_GAL_pGC pGC, T_WORD x, T_WORD y, T_WORD w, T_WORD h, T_VOID* buf, T_WORD BufLen);
	T_VOID	(*GetBox)(T_GAL_pGC pGC, T_WORD x, T_WORD y, T_WORD w, T_WORD h, T_VOID* buf, T_WORD BufLen);
	T_VOID	(*PutBoxMask)(
		     T_GAL_pGC  pGC,
		     T_WORD x,
		     T_WORD y,
		     T_WORD w,
		     T_WORD h,
		     T_VOID *buf,
		     T_WORD BufLen,
		     T_GUI_PIXEL cxx
		     );
	T_VOID 	(*CopyBox)(T_GAL_pGC pGC,T_WORD x1, T_WORD y1, T_WORD w, T_WORD h, T_WORD x2, T_WORD y2);

	T_GUI_PIXEL(*MapColor) (
			T_GAL_pGC pGC,
			T_GUI_COLOR *color
			);	/*added for porting easily 2002.6.12*/
	T_VOID 	(*PutImageArea)(
							T_GAL_pGC pGC,
							T_WORD x,
							T_WORD y,
							T_WORD w,
							T_WORD h,
							T_UBYTE *buf );
}T_GAL_ScreenDevice;

T_EXTERN T_GAL_ScreenDevice  tGAL_ScrDev;
T_EXTERN T_GAL_ScreenDevice* tpGAL_ScrDev;

#ifdef __cplusplus
}
#endif

#endif  /* _GALGHL_H */


